package com.oocl.modle;

public class Customer implements Comparable<Customer>{
	private int id;
	private String name;
	private String sex;
	private String email;
	private String birth;
	
	
	
	
	public Customer(int id, String name, String sex, String email, String birth) {
		super();
		this.id = id;
		this.name = name;
		this.sex = sex;
		this.email = email;
		this.birth = birth;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Customer other = (Customer) obj;
		if (id != other.id)
			return false;
		return true;
	}
	
	
	@Override
	public String toString() {
		return this.getId() + "\t" + this.getName() + "\t\t" + this.getEmail() + '\t' + this.getSex() + '\t' + this.getBirth() + "\r\n";
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getBirth() {
		return birth;
	}
	public void setBirth(String birth) {
		this.birth = birth;
	}
	public int compareTo(Customer c) {
		
		return this.getBirth().compareTo(c.getBirth());
	}
	
}
